package com.kuzan.autocloud.common.model.report;

import com.kuzan.autocloud.common.SelectItems;
import com.kuzan.autocloud.common.model.Base;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * <p>Description: </p>
 *
 * @author kuzank
 */
@Data
@NoArgsConstructor
@Entity
@Table(name = "sys_report")
public class Report extends Base {

    @Column
    private String collection;
    @Column(length = 32)
    private String form;
    @Column(length = 32)
    private String groupobj;


    public static Report of(String title, String collection, String form, String id) {
        Report report = new Report();
        report.setId(id);
        report.setCollection(collection);
        report.setForm(form);
        report.setTitle(title);
        report.setGroupobj(SelectItems.SystemGrup.System.value());
        report.setSort(getSortIncrement());
        return report;
    }

}
